<template>
    <section>
        <sy-baselist
                :fixWhere="'FType='+type"
                @beforeAdd="beforeAdd"
                :filters="filters"
                editVue="./system/DownLoad_Edit.vue"
                listUrl="server/system/DownLoad.ashx?cmd=GetList"
                deleteUrl="server/system/DownLoad.ashx?cmd=Delete"
        >
            <el-table-column prop="FTitle" label="文档名" width="400" >
            </el-table-column>
            <el-table-column prop="FNote" label="备注" width="300" >
            </el-table-column>
            <template scope="props" slot="extendbtn">
                <el-button  size="small" @click="openDoc(props.row)">查看文档</el-button>
            </template>
        </sy-baselist>
    </section>
</template>

<script>
    import util from '../../common/util'
    export default {
        data(){
            return {
                type:this.$router.currentRoute.query.type,
                filters: [{type: "string",name:"FTitle",text:"文档名"}]
            }
        },
        watch: {
            '$route' (to, from) {
                // 对路由变化作出响应...
                this.type = this.$router.currentRoute.query.type
            }
        },
        methods:{
            beforeAdd(row,r){
                row.FType = this.type
            },
            openDoc(row){
                window.open(global.serverHost+ "upload/" + row.FPic)
            }
        }
    }
</script>